package deprecated;

import org.springframework.core.MethodParameter;
import org.springframework.lang.Nullable;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
import org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter;

import static com.ssm.basis.service.constant.SecurityConstant.SUPPRESS_WARNING_ALL;

/**
 * 自定义参数解析(注解)
 *
 * @see RequestBodyAdviceAdapter
 * https://blog.csdn.net/Sophisticated_/article/details/102587157
 * https://blog.csdn.net/f641385712/article/details/100183979
 */
@Deprecated
class CustomParametersProcessor implements HandlerMethodArgumentResolver {
    @Override
    public boolean supportsParameter(@Nullable MethodParameter parameter) {
        return true;
    }

    @Override
    @SuppressWarnings(SUPPRESS_WARNING_ALL)
    public Object resolveArgument(@Nullable MethodParameter parameter, ModelAndViewContainer mavContainer,
                                  NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
        return parameter;
    }
}
